﻿<p:DemoWindow x:Class="WPFDemo.Windows.MainWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:p="http://schemas.awesome.com/ums/2011/xaml/presentation"              
             Title="WPF Demo App" 
             Width="525" Height="350" 
             MinWidth="525" MinHeight="350" 
             >
    <Grid Margin="5pt">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" 
                   Text="Welcome to the WPF Demo app!" 
                   p:ControlExtensions.DoDragMove="True"
                   p:ControlExtensions.UseDoDragMoveDragDistance="True"
                   />
        <Grid Grid.Row="1">
            <TabControl>
                <TabItem Header="Page 1">
                    <StackPanel>
                        <p:AlignableWrapPanel HorizontalContentAlignment="Center" Margin="5pt"
                                              MaxItemsInLine="2"
                                              >
                            <p:StarCheckBox IsChecked="True"
                                            Content="Star check box 1"
                                            />
                            <p:StarCheckBox IsChecked="True"
                                            Content="Star check box 2"
                                            />
                            <p:StarCheckBox IsChecked="True"
                                            Content="Star check box 3"
                                            />
                        </p:AlignableWrapPanel>
                        <p:IntegerUpDown />
                        <p:CurrencyTextBox Text="{Binding CurrencyValue, Converter={p:CurrencyStringConverter}}"
                                           />             
                        <p:DateTimePickerWrapper Value="{Binding DateValue}"
                                                 Height="22"
                                                 />
                    </StackPanel>                    
                </TabItem>
                <TabItem Header="Page 2">
                    <StackPanel>
                        <StackPanel.Resources>
                            <DataTemplate x:Key="CheckedListBoxExItemTemplate">
                                <TextBlock Text="{Binding Name}" />
                            </DataTemplate>
                            <Style x:Key="CheckedListBoxExItemStyle" TargetType="p:CheckedListBoxExItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                <Setter Property="IsChecked" Value="{Binding IsSelected}" />                                
                            </Style>
                            <Style x:Key="CheckedListBoxExStyle" TargetType="p:CheckedListBoxEx">
                                <Setter Property="ItemTemplate" Value="{StaticResource CheckedListBoxExItemTemplate}" />
                                <Setter Property="ItemContainerStyle" Value="{StaticResource CheckedListBoxExItemStyle}" />
                                <Setter Property="ItemsSource" Value="{Binding SelectableItemCollection}" />
                                <Setter Property="KeyboardNavigation.ControlTabNavigation" Value="Once" />
                            </Style>
                        </StackPanel.Resources>
                        <p:CheckedListBoxEx Style="{StaticResource CheckedListBoxExStyle}"                                            
                                            />
                    </StackPanel>
                    <TabItem.Style>
                        <Style TargetType="TabItem">
                            <Style.Triggers>
                                <Trigger Property="p:SystemExtensions.IsVistaOS" Value="True">
                                    <Setter Property="FontFamily" Value="Segoe UI Light" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </TabItem.Style>
                </TabItem>
                <TabItem Header="Page 3">
                    <TextBox x:Name="MouseOverAdornerTextBox" 
                                VerticalAlignment="Stretch"
                                AcceptsReturn="True"
                                TextWrapping="Wrap"
                                VerticalScrollBarVisibility="Auto"   
                                p:AdornerExtensions.ShowMouseOverAdorner="True"
                                p:AdornerExtensions.MouseOverAdornerBrush="Pink"                             
                                />
                </TabItem>
            </TabControl>
        </Grid>
        <Grid Grid.Row="2" Margin="0,5pt,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Button Grid.Column="1"
                    MinWidth="75" MinHeight="23"                    
                    Content="Exit"
                    p:Resources.ResourceLabelName="ExitButton"                    
                    Command="{Binding ExitCommand}"
                    IsCancel="True"                    
                    />
        </Grid>
    </Grid>
</p:DemoWindow>
